<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jquery.validatebox</title>
<link rel="stylesheet" type="text/css" href="../themes/default/validatebox.css" />
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
<script type="text/javascript" src="../jquery-1.10.2.js">
</script>
<script type="text/javascript" src="../src/jquery.parser.js">
</script>
<script type="text/javascript" src="../src/jquery.validatebox.js">
</script>
</head>
<body>
<div>
<a id="a1" href="#" onClick="">启用验证</a>
<a id="a2" href="#" onClick="">禁用验证</a>
</div>
<input id="tt" name="" type="text" class="xui-validatebox" data-options="required:true"/>  
<br>
<br>
<input id="tt2" name="" type="text" class="xui-validatebox" data-options="required:true"/> 
<script type="text/javascript">

$(function(){
	$('.xui-validatebox').validatebox();
	$('#a1').click(function(e) {
		$('.xui-validatebox').validatebox('enableValidation');
        $('.xui-validatebox').validatebox('validate');
    });
	$('#a2').click(function(e) {
		$('.xui-validatebox').validatebox('disableValidation');
        $('.xui-validatebox').validatebox('validate');
    });
});

</script>
</body>
</html>
